<?php
// php artisan make:seeder PaperTableSeeder 创建填充器文件
use Illuminate\Database\Seeder;
// php artisan db:seed --class=PaperTableSeeder 执行文件
class PaperTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //定义数组
        $data = [
            [
                'paper_name'    =>  '五年高考，三年模拟',
                'start_time'    =>  strtotime('+7 days'),
                'duration'      =>  '120',
            ],
            [
                'paper_name'    =>  '练习册',
                'start_time'    =>  strtotime('+5 days'),
                'duration'      =>  '120',
            ],
            [
                'paper_name'    =>  '数学试卷',
                'start_time'    =>  strtotime('+10 days'),
                'duration'      =>  '120',
            ],
        ];
        //写入数据
        DB::table('paper')->insert($data);
    }
}
